<center>
    <h2>搜索结果</h2>
    <p><?php if(isset($status) && $status == false) { echo $message;} else { ?></p>
    <table class="table table-dark table-hover" style="width: 80%;">
        <thead>
            <tr style="text-align: center;">
                <th>标题</th>
                <th>发布人</th>
                <th>负责人</th>
                <th>任务详情</th>
                <th>完成状态</th>
                <th>领取任务</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($data as $value) { ?>
                <tr style="text-align: center;">
                    <td>
                        <?php echo $value['title']; ?>
                    </td>
                    <td>
                        <?php echo $value['leader']; ?>
                    </td>
                    <td>
                        <?php echo $value['principal']; ?>
                    </td>
                    <td>
                        <?php echo $value['task_info']; ?>
                    </td>
                    <td>
                        <?php echo $value['status'] ? '已完成' : '未完成'; ?>
                    </td>
                    <td style="">
                        <form action="index.php?controller=Task&action=getTask" method="post" style="margin-bottom: 0px;">
                            <input name="title" type="text" value="<?php echo $value['title']; ?>" style="box-shadow: dark;" hidden />
                            <center><button type="submit" class="btn btn-primary"<?php echo $value['principal']? 'disabled' : ''; ?>>领取</button></center>
                        </form>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
    <?php } ?>
</center>